import React from 'react'
import {HashRouter, Route, Switch} from 'react-router-dom'
import App from './App'
import Login from './pages/login'
import Admin from './admin'
import Button from './pages/ui/buttons'
import Modal from './pages/ui/modals'
import NoMatch from './pages/nomatch'
export default class IRouter extends React.Component{

  render () {
    return (
      <HashRouter>
        <App>
          <Route path="/login" component={Login}></Route>
          <Route path="/admin" render={() => {
            return (
              <Admin>
                <Switch>
                  <Route path='/admin/ui/buttons' component={Button}></Route>
                  <Route path='/admin/ui/modals' component={Modal}></Route>
                  <Route component={NoMatch}></Route>
                </Switch>
              </Admin>
            )
          }}></Route>
          <Route path="/order/detail" component={Admin}></Route>
        </App>
      </HashRouter>
    )
  }
}
